<template>
  <div class="home">
    <van-sticky>
      <van-nav-bar
        title="饿了么"
        left-text="返回"
        right-text="···"
        left-arrow
        @click-left="onClickLeft"
        @click-right="onClickRight"
      />
      <van-tabs v-model="active">
        <van-tab title="点餐" to='/home/sidebar'/>
        <van-tab title="评价" to='/home/evaluate'/>
        <van-tab title="商家" to='/home/business'/>
      </van-tabs>
    </van-sticky>
    <router-view/>
  </div>
</template>

<script>

// @ is an alias to /src
import SidebarConent from './home/SidebarConent.vue'
export default {
  name: 'Home',
  // 数据定义
  data() {
    return {
      active: 0,
    };
  },
  // 方法函数
  methods: {
    onClickLeft() {
      Toast('返回');
    },
    onClickRight() {
      Toast('按钮');
    },
  },
  computed: {
  
  },
 
  // 组件引入
  components: {
    SidebarConent
  }
}
</script>

<style lang="scss" scoped>
.home{
  width: 100%;
  height: 100%;
  .van-tabs{
    width: 100%;
    height: 100%;
    .van-tabs__content{
      width: 100%;
      height: calc(100% - 44px)
    }
  }
}
</style>